<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
       #dv{
           display: flex;
       }
       #dvv1{
          
           width: 100px;
           height: 100px;
           background: red;
       }
       #dvv2{
           
           width: 100px;
           height: 100px;
           background: orange;
           margin-left: 300px;
           display: none;
       }
    </style>
</head>
<body>
    <div id="dv">
        <div id="dvv1">
            <button onclick="dvv1show()">切换</button>
        </div><div id="dvv2">
            <button onclick="dvv2show()">回去</button>
        </div>
    </div>
    <script>
       
               var daa=document.getElementById('dvv1')
               var dbb=document.getElementById('dvv2')
               function dvv1show() {
                     setInterval(()=>{
                             daa.style.display='none'
                           dbb.style.display='block'
                     },3000)
               }
               function dvv2show() {
                     setInterval(()=>{
                             dbb.style.display='none'
                           daa.style.display='block'
                     },3000)
               }
    </script>
</body>
</html>